﻿using System;
using System.Collections.Generic;

namespace YJ.Data.Interface
{
    public interface IDocuments
    {
        /// <summary>
        /// 新增
        /// </summary>
        int Add(YJ.Data.Model.Documents model);

        /// <summary>
        /// 更新
        /// </summary>
        int Update(YJ.Data.Model.Documents model);

        /// <summary>
        /// 查询所有记录
        /// </summary>
        List<YJ.Data.Model.Documents> GetAll();

        /// <summary>
        /// 查询单条记录
        /// </summary>
        Model.Documents Get(Guid id);

        /// <summary>
        /// 删除
        /// </summary>
        int Delete(Guid id);

        /// <summary>
        /// 查询记录条数
        /// </summary>
        long GetCount();

        /// <summary>
        /// 得到一页列表
        /// </summary>
        /// <param name="pager"></param>
        /// <param name="query"></param>
        /// <param name="title"></param>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        System.Data.DataTable GetList(out string pager, string dirID, string userID, string query = "", string title = "", string date1 = "", string date2 = "", bool isNoRead = false);

        /// <summary>
        /// 得到一页列表
        /// </summary>
        /// <param name="dirID">栏目ID，多个栏目逗号分开</param>
        /// <param name="pager"></param>
        /// <param name="query"></param>
        /// <param name="title"></param>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        System.Data.DataTable GetList(out long count, int size, int number, string dirID, string userID, string title = "", string date1 = "", string date2 = "", bool isNoRead = false, string order = "");
        /// <summary>
        /// 更新阅读次数+1
        /// </summary>
        /// <param name="id"></param>
        void UpdateReadCount(Guid id);

        /// <summary>
        /// 删除记录
        /// </summary>
        int DeleteByDirectoryID(Guid directoryID);
    }
}
